package com.puti.doctor.domain;


import java.io.Serializable;

/**
 * @ProjectName: smartmedicine
 * @Package: com.qianxi.smartmedicine.util
 * @Author: 你我山巅自相逢
 * @Date: 2021/4/21 16:58
 * @Version: 1.0
 */
//泛型
public  class Result<T> implements Serializable {
    private  int code;

    private  String msg;

    private  T data;

    //静态方法
   public static Result a(int code ,String msg){
       return new Result(code,msg);
   }

    public static<T> Result b(int code ,String msg,T data){
        return new Result(code,msg,data);
    }

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public int getCode()
    {
        return code;
    }

    public void setCode(int code)
    {
        this.code = code;
    }

    public String getMsg()
    {
        return msg;
    }

    public void setMsg(String msg)
    {
        this.msg = msg;
    }

    public T getData()
    {
        return data;
    }

    public void setData(T data)
    {
        this.data = data;
    }
}
